<?php
/* @var $this EmailsController */
/* @var $model Emails */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'emails-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>true,	
	'clientOptions'=>array('validateOnSubmit'=>true),
)); ?>

<ul class="form_list form_list2">

	<li class="title">
		<span class="fs_14 fw_b"><?php echo ($model->isNewRecord)?Yii::t('glo','Create'):Yii::t('glo','Update') ?> Emails</span>
	</li>
	
	<?php echo $form->errorSummary($model); ?>

	<li class="c_f">
		<span class="tit"><?php echo $form->labelEx($model,'zes_title'); ?>：</span>
		<div class="cont f_l">
			<?php echo $form->textField($model,'zes_title',array('size'=>60,'maxlength'=>100)); ?>
			<?php echo $form->error($model,'zes_title'); ?>
		</div>
	</li>

	<li class="c_f">
		<span class="tit"><?php echo $form->labelEx($model,'zes_type'); ?>：</span>
		<div class="cont f_l">
			<?php echo $form->radioButtonList($model,'zes_type',Emails::model()->getType(),array('class'=>'chk select_type','labelOptions'=>array('class'=>'mr20'))); ?>
			<?php echo $form->error($model,'zes_type'); ?>
		</div>
	</li>

	<li class="c_f d_n" id="member_ids">
		<span class="tit"><?php echo $form->labelEx($model,'zm_ids'); ?>：</span>
		<div class="cont f_l">
			<?php echo $form->textField($model,'zm_ids',array('size'=>60,'maxlength'=>255)); ?>
			<?php echo $form->error($model,'zm_ids'); ?>
		</div>
	</li>

	<li class="c_f d_n" id="assign_mails">
		<span class="tit"><?php echo $form->labelEx($model,'zml_tomail'); ?>：</span>
		<div class="cont f_l">
			<?php echo $form->textField($model,'zml_tomail',array('size'=>60,'maxlength'=>1000)); ?>
			<?php echo $form->error($model,'zml_tomail'); ?>
		</div>
	</li>
	
	<li class="c_f">
		<span class="tit"><?php echo $form->labelEx($model,'zes_content'); ?>：</span>
		<div class="cont f_l">
			<?php  $this->widget('ext.keditor.KEditor',array('model'=>$model,'name'=>'zes_content')); ?>
			<?php echo $form->error($model,'zes_content'); ?>
		</div>
	</li>

	<li class="c_f"><span class="tit">&nbsp;</span>
		<div class="cont f_l">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('glo','Create') : Yii::t('glo','Save'),array('class'=>'mem_btn mem_btn20 mr5')); ?>
		</div>
	</li>
</ul>
<?php $this->endWidget(); ?>

<script type="text/javascript">
	$('.select_type').bind('click',function(){
		if($(this).val()==2){
			$('#assign_mails').hide();
			$('#member_ids').slideDown("slow");
		}else if($(this).val()==3){
			$('#member_ids').hide();
			$('#assign_mails').slideDown("slow");
		}else{
			$('#member_ids').slideUp("slow");
			$('#assign_mails').slideUp("slow");
		}
	});
</script>